#最好创建运行测试套件的单独的模块
import time
import unittest

from tools.HTMLTestRunner import HTMLTestRunner

suite = unittest.TestSuite()
tests = unittest.defaultTestLoader.discover('./scripts/', pattern='test*_p.py')
suite.addTest(tests)

now = time.strftime("%Y%m%d %H%M%S", time.localtime())
reportFile = "./report/"+"result.html"
fp = open(reportFile, 'wb')
runner = HTMLTestRunner(stream=fp, title=u'进销存测试报告', description=u'登录')
runner.run(suite)
fp.close()

